﻿using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;

#nullable disable

namespace PowerManage.DbMigrator.Migrations
{
    /// <inheritdoc />
    public partial class 增加审核日志 : Migration
    {
        /// <inheritdoc />
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "EleAuditLog",
                columns: table => new
                {
                    Id = table.Column<long>(type: "bigint", nullable: false)
                        .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
                    ApiUrl = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "API接口地址"),
                    Method = table.Column<string>(type: "character varying(256)", maxLength: 256, nullable: false, comment: "接口的方法"),
                    Parameters = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "参数"),
                    ReturnValue = table.Column<string>(type: "text", nullable: false, comment: "返回结果"),
                    ExecutionDuration = table.Column<int>(type: "integer", nullable: false, comment: "执行时间"),
                    ClientIpAddress = table.Column<string>(type: "character varying(64)", maxLength: 64, nullable: false, comment: "客户端IP"),
                    BrowserInfo = table.Column<string>(type: "character varying(512)", maxLength: 512, nullable: false, comment: "浏览器信息"),
                    AuditLogType = table.Column<int>(type: "integer", nullable: false, comment: "日志类型 0:正常日志记录，99：异常日志"),
                    ExceptionMessage = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false, comment: "异常信息"),
                    Exception = table.Column<string>(type: "character varying(2000)", maxLength: 2000, nullable: false, comment: "详细异常"),
                    CreatorId = table.Column<long>(type: "bigint", nullable: false, comment: "创建者Id"),
                    CreationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, comment: "创建时间"),
                    LastModificationTime = table.Column<DateTime>(type: "timestamp without time zone", nullable: false, comment: "最后编辑时间")
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_EleAuditLog", x => x.Id);
                });

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3627));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3632));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3634));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 4L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3637));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 5L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3639));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 6L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3653));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 7L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3655));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 8L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3656));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 9L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3658));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 10L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3661));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 11L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3662));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 12L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3664));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 13L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3665));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 14L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3667));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 15L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3669));

            migrationBuilder.UpdateData(
                table: "EleRole",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 340, DateTimeKind.Local).AddTicks(7498));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3788));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3792));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3793));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 4L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3793));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 5L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3794));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 6L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3795));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 7L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3796));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 8L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3796));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 9L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3797));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 10L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3798));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 11L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3798));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 12L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3798));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 13L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3799));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 14L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3799));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 15L,
                column: "CreationTime",
                value: new DateTime(2025, 7, 7, 17, 55, 22, 383, DateTimeKind.Local).AddTicks(3800));

            migrationBuilder.UpdateData(
                table: "EleUser",
                keyColumn: "Id",
                keyValue: 1L,
                columns: new[] { "ConcurrencyStamp", "CreationTime", "PasswordHash", "SecurityStamp" },
                values: new object[] { "1c6c2010-1df7-40ec-8a74-f81d8e22a9aa", new DateTime(2025, 7, 7, 17, 55, 22, 340, DateTimeKind.Local).AddTicks(7718), "AQAAAAIAAYagAAAAEFuaRzqVxkwDPc+qnjtF49NYVEHSJRbb6hyMyXiGl48FtSvag5e1OPQmofatgG21dg==", "dd38cee7-21bd-4b80-9f04-ccafa56c2f46" });

            migrationBuilder.CreateIndex(
                name: "IX_EleAuditLog_AuditLogType",
                table: "EleAuditLog",
                column: "AuditLogType");
        }

        /// <inheritdoc />
        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "EleAuditLog");

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8884));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8892));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8894));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 4L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8897));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 5L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8900));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 6L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8918));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 7L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8920));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 8L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8922));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 9L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8924));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 10L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8927));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 11L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8929));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 12L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(8931));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 13L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9004));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 14L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9006));

            migrationBuilder.UpdateData(
                table: "ElePermission",
                keyColumn: "Id",
                keyValue: 15L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9008));

            migrationBuilder.UpdateData(
                table: "EleRole",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 67, DateTimeKind.Local).AddTicks(2969));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 1L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9085));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 2L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9090));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 3L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9091));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 4L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9092));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 5L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9093));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 6L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9094));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 7L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9095));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 8L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9096));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 9L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9096));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 10L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9098));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 11L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9098));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 12L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9099));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 13L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9099));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 14L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9100));

            migrationBuilder.UpdateData(
                table: "EleRolePermission",
                keyColumn: "Id",
                keyValue: 15L,
                column: "CreationTime",
                value: new DateTime(2025, 6, 3, 13, 59, 4, 111, DateTimeKind.Local).AddTicks(9100));

            migrationBuilder.UpdateData(
                table: "EleUser",
                keyColumn: "Id",
                keyValue: 1L,
                columns: new[] { "ConcurrencyStamp", "CreationTime", "PasswordHash", "SecurityStamp" },
                values: new object[] { "f960ad02-003c-484d-af5f-950e546e8acf", new DateTime(2025, 6, 3, 13, 59, 4, 67, DateTimeKind.Local).AddTicks(3133), "AQAAAAIAAYagAAAAEAc9Edvir3+rK8UJHL+fMS/9uvyx5agcGyi+dhX9JxEuXCG5P8R7VIdYVAqYpjK/oA==", "7b70b5c4-46c0-4506-a7ac-1c9e29b39fba" });
        }
    }
}
